//
//  UploadMusicController.m
//  planning
//
//  Created by mac on 2019/7/30.
//  Copyright © 2019 mac. All rights reserved.
//

#import "UploadMusicController.h"
//#import "MyHTTPConnection.h"
//#import "SJXCSMIPHelper.h"
//#import "MyHttpServer.h"

@interface UploadMusicController ()
{
//    MyHttpServer * myHttpServer;
}

@property (weak, nonatomic) IBOutlet UILabel *showIpLabel;

@property (nonatomic, strong) NSMutableArray *fileArray;

@end

@implementation UploadMusicController

-(void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    
    //开启httpsServer服务
//    myHttpServer = [MyHttpServer shared];
//    [myHttpServer startServer];
    
    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;
}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    
    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(showFile) name:@"processEpilogueData" object:nil];
    
//    self.showIpLabel.text = [NSString stringWithFormat:@"https://%@:15159", [SJXCSMIPHelper deviceIPAdress]];
}


- (void)showFile {
    
    dispatch_async(dispatch_get_main_queue(), ^{
        NSFileManager *fileManager=[NSFileManager defaultManager];
        NSString *documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject];
        NSLog(@"地址：%@", documentsPath);
        
//        self.fileArray = [NSMutableArray arrayWithArray:[fileManager contentsOfDirectoryAtPath:documentsPath error:nil]];

    });
    
}

- (void)dealloc {
    [[NSNotificationCenter defaultCenter] removeObserver:self];
//    [myHttpServer stopServer];
//    myHttpServer = nil;
}

@end
